import request from "@/utils/request";
import type { HospitalResponseData, HospitalLevelAndRegionResponseData, HospitalInfo } from "./type";

enum API {
    HOSPITAL_URL = '/hosp/hospital/',
    HOSPITALLEVELANDREGION_URL = '/cmn/dict/findByDictCode/',
    HOSPITALDETIAL_URL = '/hosp/hospital/findByHosname/'
}


export const reqHospital = (page?:number, limit?:number, hostype='', districtCode='')=> request.get<any, HospitalResponseData>(API.HOSPITAL_URL+ `${page}/${limit}?hostype=${hostype}?districtCode=${districtCode}`)

export const reqHospitalLevelAndRegion = (distCode:string) => request.get<any, HospitalLevelAndRegionResponseData>(API.HOSPITALLEVELANDREGION_URL + distCode)

export const reqHospitalInfo = (hosname:string) => request.get<any, HospitalInfo>(API.HOSPITALDETIAL_URL + hosname);